diff options
Diffstat (limited to 'app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx')
| -rw-r--r-- | app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx b/app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx index 1c830535..5506825d 100644 --- a/app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx +++ b/app/[lng]/partners/(partners)/techsales/rfq-offshore-hull/page.tsx @@ -3,16 +3,9 @@ import Link from "next/link"; import { Metadata } from "next"; import { getServerSession } from "next-auth/next"; import { authOptions } from "@/app/api/auth/[...nextauth]/route"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { LogIn } from "lucide-react"; import { Shell } from "@/components/shell"; -import { - TECH_SALES_QUOTATION_STATUSES, - TECH_SALES_QUOTATION_STATUS_CONFIG -} from "@/db/schema"; - -import { getQuotationStatusCounts } from "@/lib/techsales-rfq/service"; import { VendorQuotationsTable } from "@/lib/techsales-rfq/vendor-response/table/vendor-quotations-table"; export const metadata: Metadata = { @@ -62,9 +55,6 @@ export default async function VendorQuotationsHullPage() { ); } - // 견적서 상태별 개수 조회 - const statusCountsPromise = getQuotationStatusCounts(vendorId.toString(), "HULL"); - return ( <Shell variant="fullscreen" className="h-full"> {/* 고정 헤더 영역 */} @@ -78,30 +68,6 @@ export default async function VendorQuotationsHullPage() { </div> </div> - {/* 상태별 개수 카드 */} - <div className="flex-shrink-0"> - <React.Suspense - fallback={ - <div className="w-full overflow-x-auto"> - <div className="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 min-w-fit"> - {Array.from({ length: 5 }).map((_, i) => ( - <Card key={i} className="min-w-[160px]"> - <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> - <CardTitle className="text-sm font-medium truncate">로딩중...</CardTitle> - </CardHeader> - <CardContent> - <div className="text-2xl font-bold">-</div> - </CardContent> - </Card> - ))} - </div> - </div> - } - > - <StatusCards statusCountsPromise={statusCountsPromise} /> - </React.Suspense> - </div> - {/* 견적서 테이블 */} <div className="flex-1 min-h-0 overflow-hidden"> <div className="h-full overflow-auto"> @@ -112,65 +78,3 @@ export default async function VendorQuotationsHullPage() { </Shell> ); } - -// 상태별 개수 카드 컴포넌트 -async function StatusCards({ - statusCountsPromise, -}: { - statusCountsPromise: Promise<{ - data: { status: string; count: number }[] | null; - error: string | null; - }>; -}) { - const { data: statusCounts, error } = await statusCountsPromise; - - if (error || !statusCounts) { - return ( - <div className="w-full overflow-x-auto"> - <div className="grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 min-w-fit"> - <Card className="min-w-[160px]"> - <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> - <CardTitle className="text-sm font-medium truncate">오류</CardTitle> - </CardHeader> - <CardContent> - <div className="text-2xl font-bold text-red-600">-</div> - <p className="text-xs text-muted-foreground truncate"> - 데이터를 불러올 수 없습니다 - </p> - </CardContent> - </Card> - </div> - </div> - ); - } - - // 중앙화된 상태 설정 사용 - const statusEntries = Object.entries(TECH_SALES_QUOTATION_STATUSES).map(([, statusValue]) => ({ - key: statusValue, - ...TECH_SALES_QUOTATION_STATUS_CONFIG[statusValue] - })); - - console.log(statusCounts, "statusCounts") - - return ( - <div className="w-full overflow-x-auto"> - <div className="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 min-w-fit"> - {statusEntries.map((status) => ( - <Card key={status.key} className="min-w-[160px]"> - <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> - <CardTitle className="text-sm font-medium truncate">{status.label}</CardTitle> - </CardHeader> - <CardContent> - <div className={`text-2xl font-bold ${status.color}`}> - {statusCounts.find(item => item.status === status.key)?.count || 0} - </div> - <p className="text-xs text-muted-foreground truncate"> - {status.description} - </p> - </CardContent> - </Card> - ))} - </div> - </div> - ); -}
\ No newline at end of file |
